package com.yonyou.pmclouds.statistic.rmiitf;

import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.problemlog.entity.ProblemLogVO;
import com.yonyou.pmclouds.statistic.entity.ProReasonCountVO;
import com.yonyou.pmclouds.statistic.entity.ProblemReasonPercentageVO;
import com.yonyou.pmclouds.statistic.entity.ProblemReasonViewVO;
import com.yonyou.pmclouds.statistic.entity.ProblemReportVO;
import com.yonyou.pmclouds.team.entity.TeamEnterpriseVO;
import com.yonyou.pmclouds.team.entity.TeamMemberVO;

import java.util.List;
import java.util.Map;

/**
 * 
 * <p>
 * <b>本类主要完成以下功能：问题原因统计报表查询服务</b>
 * 
 * @version pm_cloud
 * @author zhangwce
 * @time 2017年11月25日 上午10:25:25
 */
public interface ProblemReasonAnalyseRemoteService {
	/**
	 * 
	 * 方法功能描述：问题原因统计。
	 * 
	 * <b>参数说明</b>
	 * @param pk_tenant
	 * @param start_date
	 * @param end_date
	 * @return
	 * @author zhangwce
	 * @time 2017年11月25日 上午10:25:08
	 */
    List<ProReasonCountVO> queryProblemReasonAnalyse(String pk_tenant, String[] pkProjects, String start_date, String end_date) throws BusinessException;

    List<ProblemReasonPercentageVO> queryProblemReasonCount(String tenantId, String startTime, String orgId) throws BusinessException;

    List<ProblemLogVO> queryOverdueCount(String tenantId, byte billStatus, String orgId) throws BusinessException;

    TeamMemberVO[] queryTeamMemberById(String[] userIds) throws BusinessException;

    TeamEnterpriseVO[] queryTeamEnterpriseById(String[] enpIds) throws BusinessException;

    /**
     * 根据租户、组织、时间和问题原因名称过滤问题记录
     *
     * @param tenantId
     * @param problemName
     * @param range
     * @param orgId
     * @return 问题记录VO集合
     * @throws BusinessException
     */
    List<ProblemLogVO> queryProblemLogByTimeAndReason(String tenantId, String[] problemName, String range, String orgId) throws BusinessException;

    /**
     * 通过整改人和项目查询未关闭的所有问题记录
     *
     * @param tenantId
     * @param pkRectificationers
     * @param pkProjects
     * @return
     * @throws BusinessException
     */
    List<ProblemLogVO> queryNotEndProblemLogByRectsAndProjects(String tenantId, String[] pkRectificationers, String[] pkProjects) throws BusinessException;

    /**
     * web统计分析未关闭问题报表穿透，通过施工单位和是否超期来查询
     *
     * @param tenantId
     * @param pkEnterprise
     * @param enterpriseName
     * @param overdue
     * @return
     * @throws BusinessException
     */
    List<ProblemReportVO> queryProblemReportByEntAndOverdue(String tenantId, String pkEnterprise, String enterpriseName, byte overdue, String orgId) throws BusinessException;

    /**
     * web统计分析问题多发分析报表穿透，通过时间范围和问题原因名查询
     *
     * @param tenantId
     * @param problemName
     * @param range
     * @return
     * @throws BusinessException
     */
    List<ProblemReportVO> queryProblemReportByRangeAndReason(String tenantId, String[] problemName, String range, Map<String, String> userIdMap, String orgId) throws BusinessException;

    List<ProblemReasonViewVO> queryProblemLogAnalyseByReason(String tenantId, String pkOrg, String[] pkProblemReason, String startDate, String endDate) throws BusinessException;
}
